import 'package:casdon/modules/demo/data/api/demo_ocr_api.dart';

class DemoOcrState {
  final bool isLoading;
  final ResponseDemoOcrApi? ocrResult;
  final String imagePath; // 本地地址
  final String? imageUrl; // oss地址

  DemoOcrState({
    required this.imagePath,
    this.isLoading = true,
    this.ocrResult,
    this.imageUrl,
  });

  DemoOcrState copyWith({
    bool? isLoading,
    ResponseDemoOcrApi? ocrResult,
    String? imagePath,
    String? imageUrl,
  }) {
    return DemoOcrState(
      imagePath: imagePath ?? this.imagePath,
      imageUrl: imageUrl ?? this.imageUrl,
      isLoading: isLoading ?? this.isLoading,
      ocrResult: ocrResult ?? this.ocrResult,
    );
  }
}
// state = state.copyWith(ocrResult: getResult, isLoading: false);